﻿@model Vnsf.WebHost.Models.ApplicationBindingModel

@{
    ViewBag.Title = "Apply";
}

<h2>Apply</h2>

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()

    <div class="form-horizontal">
        <h4>Application</h4>
        <hr />
        @Html.ValidationSummary(true)
        
        <div class="form-group">
            @Html.LabelFor(model => model.application.BudgetTotal, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.application.BudgetTotal)
                @Html.ValidationMessageFor(model => model.application.BudgetTotal)
            </div>
        </div>

        @Html.DisplayFor(model => model.User.Email)
        @Html.DisplayFor(model => model.Opportunity.Grant.Name)
        @Html.DisplayFor(model => model.Opportunity.Name)

        @foreach (var item in Model.Documents)
        {
            <div>
                <label>@item.Name</label>
                <input type="file" name="@item.Name" />
            </div>
        }
        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Save" class="btn btn-default" />
            </div>
        </div>
    </div>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
